using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace qPrintComponent
{
    //typedef struct _DRIVER_INFO_5 {
    //  DWORD      cVersion;            :0 
    //  LPTSTR     pName;               :1 
    //  LPTSTR     pEnvironment;        :2 
    //  LPTSTR     pDriverPath;         :3
    //  LPTSTR     pDataFile;           :4
    //  LPTSTR     pConfigFile;         :5
    //  DWORD      dwDriverAttributes;  :6
    //  DWORD      dwConfigVersion;     :7
    //  DWORD      dwDriverVersion;     :8
    //} DRIVER_INFO_5, *PDRIVER_INFO_5;

   
    public sealed class DriverInfo5 : qSafeDriverInfo
    {
        public DriverInfo5(SafeHandle PrinterHandle)
            : base(PrinterHandle, 5)
        { }
        
        public DriverInfo5(IntPtr MemoryHandle)
            : base(MemoryHandle, 5)
        { }

        public override string ToString()
        {
            return DriverPath;
        }

        [Description(@"Specifies the operating system version for which the driver was written. Currently it can be the following. Value Meaning 3 Driver for Windows 2000/XP.")]
        public int Version
        {
            get { return GetIntField(0); }
        }
        [Description(@"The name of the driver (for example, QMS 810).")]
        public string Name
        {
            get { return GetStringField(1); }
        }
        [Description(@"The environment for which the driver was written (for example, Windows NT x86, Windows IA64, Windows x64, Windows NT R4000, Windows NT Alpha_AXP, Windows 4.0, or Windows NT PowerPC).")]
        public string Environment
        {
            get { return GetStringField(2); }
        }
        [Description(@"The file that contains the device driver (for example, C:\DRIVERS\Pscript.dll).")]
        public string DriverPath
        {
            get { return GetStringField(3); }
        }
        [Description(@"The file that contains driver data (for example, C:\DRIVERS\Qms810.ppd).")]
        public string DataFile
        {
            get { return GetStringField(4); }
        }
        [Description(@"Tthe device driver's configuration dynamic-link library (for example, C:\DRIVERS\Pscrptui.dll).")]
        public string ConfigFile
        {
            get { return GetStringField(5); }
        }
        [Description(@"Driver attributes, like UMPD (User Mode Printer Driver) / KMPD (K???ompany Mode Printer Driver).")]
        public int DriverAttributes
        {
            get { return GetIntField(6); }
        }
        [Description(@"Version number of the configuration file since restart.")]
        public int ConfigVersion
        {
            get { return GetIntField(7); }
        }
        [Description(@"Version number of the driver since restart. ")]
        public int DriverVersion
        {
            get { return GetIntField(8); }

        }         
    }
}
